package com.ss.android.download;

class StopRequestException extends Exception {
    private final int mFinalStatus;
    private static final long serialVersionUID = -2378731952523070735L;

    public StopRequestException(int arg1, String arg2) {
        super(arg2);
        this.mFinalStatus = arg1;
    }

    public StopRequestException(int arg1, String arg2, Throwable arg3) {
        super(arg2, arg3);
        this.mFinalStatus = arg1;
    }

    public StopRequestException(int arg1, Throwable arg2) {
        super(arg2);
        this.mFinalStatus = arg1;
    }

    public int getFinalStatus() {
        return this.mFinalStatus;
    }

    public static StopRequestException throwUnhandledHttpError(int arg3, String arg4) throws StopRequestException {
        int v2 = 400;
        String v0 = "Unhandled HTTP response: " + arg3 + " " + arg4;
        if(arg3 >= v2 && arg3 < 600) {
            throw new StopRequestException(arg3, v0);
        }

        if(arg3 >= 300 && arg3 < v2) {
            throw new StopRequestException(493, v0);
        }

        throw new StopRequestException(494, v0);
    }
}

